package bots;

import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;

import surface.Surface;
import utils.Vector3;
import weapons.Bullet;

/**
 * Un bot
 * @author Fabien BINI & Nicolas POIRIER
 *
 */
public abstract class Bot
{
	protected Color color;
	protected int hp;
	protected int radius;
    protected Vector3 position;
	protected Surface surface;
	
	protected int rangeBullet;
	protected int rangeVision;
	protected int reloadTime;
	protected int power;
	protected float velocityBullet;
	protected int timerReload;
	
	public Bot(Color color, int hp, int radius, int x, int y, Surface surface, int rangeBullet, int rangeVision, int reloadTime, int power, float velocityBullet) {
		this.color = color;
		this.hp = hp;
		this.radius = radius;
		this.position = new Vector3(x, y, 0);
		this.surface = surface;

		this.timerReload = 0;
		this.rangeBullet = rangeBullet;
		this.rangeVision = rangeVision;
		this.reloadTime = reloadTime;
		this.power = power;
		this.velocityBullet = velocityBullet;
	}

	public int getHp() {
		return hp;
	}

	public void setHp(int hp) {
		this.hp = hp;
	}
	
	public int getRadius() {
		return radius;
	}

	public void setRadius(int radius) {
		this.radius = radius;
	}
	
	public Color getColor()
	{
		return color;
	}

	public Vector3 getPosition() {
		return position;
	}

	public void removeHp(int power) {
		hp -= power;		
	}
	
	/**
	 * Update le bot
	 */
	public abstract void update(ArrayList<Bot> bots, ArrayList<Bullet> bullets);

	/**
	 * Dessine le bot
	 */
	public abstract void draw(Graphics g);
}